//
//  AgreeProtocolView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/7.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "AgreeProtocolView.h"
#import <Masonry.h>
@implementation AgreeProtocolView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    
    self.backgroundColor = [UIColor whiteColor];
        
    self.radioBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.radioBtn setImage:[UIImage imageNamed:@"btn_radio_normal"] forState:(UIControlStateNormal)];
    [self.radioBtn setImage:[UIImage imageNamed:@"btn_radio_pressed"] forState:(UIControlStateSelected)];
    [self addSubview:self.radioBtn];
    [self.radioBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
    
    self.tipsLab = [[UILabel alloc] init];
    self.tipsLab.text = @"同意并已阅读";
    self.tipsLab.font = [UIFont systemFontOfSize:12.0f];
    self.tipsLab.textColor = [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1];
    [self addSubview:self.tipsLab];
    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.radioBtn.mas_right).offset(5);
        make.centerY.equalTo(self.radioBtn);
    }];
    
//    self.protocolLab = [[UILabel alloc] init];
//    self.protocolLab.text = @"《服务协议》《法律声明及隐私权政策》";
//    self.protocolLab.font = [UIFont systemFontOfSize:12.0f];
//    self.protocolLab.textColor = [UIColor colorWithRed:49/255.0 green:138/255.0 blue:255/255.0 alpha:1.0];
//    [self addSubview:self.protocolLab];
//    [self.protocolLab mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.tipsLab.mas_right);
//        make.centerY.equalTo(self.radioBtn);
//    }];
    
    self.serveBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.serveBtn setTitle:@"《服务协议》" forState:UIControlStateNormal];
    [self.serveBtn setTitleColor:[UIColor colorWithRed:49/255.0 green:138/255.0 blue:255/255.0 alpha:1.0] forState:UIControlStateNormal];
    [self.serveBtn.titleLabel setFont: [UIFont systemFontOfSize:12.0f]];
    [self addSubview:self.serveBtn];

    [self.serveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.tipsLab.mas_right);
        make.centerY.equalTo(self.radioBtn);
        make.height.equalTo(self);
    }];
    
    self.layerBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.layerBtn setTitle:@"《法律声明及隐私权政策》" forState:UIControlStateNormal];
    [self.layerBtn.titleLabel setFont: [UIFont systemFontOfSize:12.0f]];
    [self.layerBtn setTitleColor:[UIColor colorWithRed:49/255.0 green:138/255.0 blue:255/255.0 alpha:1.0] forState:UIControlStateNormal];
    [self addSubview:self.layerBtn];
    [self.layerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.serveBtn.mas_right);
        make.centerY.equalTo(self.radioBtn);
         make.height.equalTo(self);
    }];
    

}

@end
